package org.chen.spring.cloud.finchley.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * 由于Spring Security 默认使用csrf,所以在使用的时候需要先禁用
 *
 * @author chensj
 * @date 2020-02-07 2:45
 */
@EnableWebSecurity
public class SecurityConfig  extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        // 禁用 csrf
        http.csrf().disable();
    }
}
